package com.bookCodeDemo;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/Echod")
public class EchodServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String name = Thread.currentThread().getName();
        resp.setContentType("text/plain");

        try (PrintWriter writer = resp.getWriter()) {
            writer.println("this HttpServletThreadName " + name);
            writer.flush();
        }
    }

    public static void main(String[] args) {
        String url = "测试人员";
        int i = url.indexOf("测试");
        System.out.println(url.indexOf("测试") > -1);

    }
}
